/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import request from '../utils/request';

// 范围列表
export async function getScopeList(params) {
  return request('/Api/Handle/run', {
    method: 'POST',
    body: {
      data: JSON.stringify({
        time: new Date().getTime(),
        run: '/Delivery/show',
        data: params,
      }),
    },
  });
}

// 添加或编辑
export async function scopeAdd(params) {
  return request('/Api/Handle/run', {
    method: 'POST',
    body: {
      data: JSON.stringify({
        time: new Date().getTime(),
        run: '/Delivery/areaAdd',
        data: params,
      }),
    },
  });
}

// 删除配送范围
export async function scopeDelete(params) {
  return request('/Api/Handle/run', {
    method: 'POST',
    body: {
      data: JSON.stringify({
        time: new Date().getTime(),
        run: '/Delivery/change',
        data: params,
      }),
    },
  });
}

// 冻结或开启
export async function scopeFreeze(params) {
  return request('/Api/Handle/run', {
    method: 'POST',
    body: {
      data: JSON.stringify({
        time: new Date().getTime(),
        run: '/Delivery/change',
        data: params,
      }),
    },
  });
}
